<controls:ChildWindow 
    x:Class="ibba.src.noriskbo.PageGarantia"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" 
    xmlns:sdk="http://schemas.microsoft.com/winfx/2006/xaml/presentation/sdk"
    xmlns:toolkit="http://schemas.microsoft.com/winfx/2006/xaml/presentation/toolkit"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" 
    xmlns:controls="clr-namespace:System.Windows.Controls;assembly=System.Windows.Controls"        
    xmlns:slc="clr-namespace:ibba.src.sl.componentes;assembly=ibba.src.sl.componentes"
    xmlns:slrv="clr-namespace:ibba.src.sl.recursos.Validations;assembly=ibba.src.sl.recursos"
    xmlns:slr="clr-namespace:ibba.src.sl.recursos;assembly=ibba.src.sl.recursos"
    Width="Auto" Height="Auto" 
    Title="Page Garantia"
    Style="{StaticResource ChildWindowStyle}">

    <Grid x:Name="LayoutRoot" Background="White"> <!-- Background="#FFE7E7EF"> -->
        <toolkit:BusyIndicator x:Name="favorAguardar">
            <StackPanel Orientation="Vertical">
                <Grid> 
                    <Grid.RowDefinitions>
                        <RowDefinition Height="Auto"/>
                        <RowDefinition Height="Auto"/>
                        <RowDefinition Height="Auto"/>
                    </Grid.RowDefinitions>

                    <slrv:ValidationManager x:Name="validatorManager" />

                    <Border Grid.Row="0" CornerRadius="10,0,10,0" BorderThickness="1" BorderBrush="#FF5A7194" Background="#FFE7E9EC" Padding="3">
                        <StackPanel Orientation="Horizontal">
                            <TextBlock Text="Grupo:" FontWeight="Bold" FontSize="12"/>
                            <TextBlock x:Name="lblNomeGrupo" FontSize="12" Margin="3,0" Width="420" />

                            <!--<StackPanel Orientation="Horizontal" MinWidth="435">
                                <TextBlock Text="{Binding IdGrupo}" FontSize="12" Margin="3,0" />
                                <TextBlock Text="-"/>
                                <TextBlock Text="{Binding NomeGrupo}" MinWidth="20" FontSize="12" Margin="3,0" />
                            </StackPanel>-->

                            <TextBlock Text="Origem:" FontWeight="Bold" FontSize="12" Margin="10,0,0,0"/>
                            <TextBlock x:Name="lblOrigem" MinWidth="80" FontSize="12" Margin="3,0" />

                            <TextBlock Text="Status:" FontWeight="Bold" FontSize="12" Margin="10,0,0,0"/>
                            <TextBlock x:Name="lblDescricaoStatus" MinWidth="150" FontSize="12" Margin="3,0" />
                        </StackPanel>
                    </Border>

                    <Border CornerRadius="5,5,5,5" BorderThickness="1" BorderBrush="#FF5A7194" Background="White" Margin="0,2,0,-12" Padding="2" Grid.Row="2"
                        Height="39">
                        <StackPanel x:Name="gridRodape" Orientation="Vertical">
                            <StackPanel x:Name="panelUsuarioInc" Orientation="Horizontal">
                                <TextBlock Text="Incluído por:" VerticalAlignment="Center" FontWeight="Bold" Width="80" Margin="5,0,0,0" />
                                <TextBlock x:Name="lblUsuarioIncluiu" Text="{Binding Garantia.UsuarioIncluiu}" VerticalAlignment="Center" Margin="5,0,0,0" MinWidth="400" />
                                <TextBlock x:Name="lblDataInclusao" Text="{Binding Garantia.DataInclusao, Converter={StaticResource DateTimeConverter}}" VerticalAlignment="Center" Margin="5,0,0,0"/>
                            </StackPanel>
                            <StackPanel x:Name="panelUsuarioAlt" Orientation="Horizontal">
                                <TextBlock Text="Alterado por:" VerticalAlignment="Center" FontWeight="Bold" Width="80" Margin="5,0,0,0" />
                                <TextBlock x:Name="lblUsuarioAlterou" Text="{Binding Garantia.UsuarioAlterou}" VerticalAlignment="Center" Margin="5,0,0,0" MinWidth="400" />
                                <TextBlock x:Name="lblDataAlteracao" Text="{Binding Garantia.DataAlteracao, Converter={StaticResource DateTimeConverter}}" VerticalAlignment="Center" Margin="5,0,0,0"/>
                            </StackPanel>
                        </StackPanel>
                    </Border>

                    <Grid Grid.Row="1" Margin="0,8,0,0">
                        <Grid.ColumnDefinitions>
                            <ColumnDefinition Width="Auto"/>
                            <ColumnDefinition/>
                        </Grid.ColumnDefinitions>

                        <StackPanel Orientation="Vertical" Grid.Row="1" Grid.Column="0">
                            <Border CornerRadius="5,5,5,5" BorderThickness="1" BorderBrush="#FF5A7194" Background="WhiteSmoke" Margin="0,2">
                                <StackPanel Orientation="Vertical" MinHeight="149">
                                    <Grid Background="White" HorizontalAlignment="Left" Margin="10,-8,0,2">
                                        <TextBlock Text="Chave do Contrato/Garantia" FontSize="11" Margin="5,0"/>
                                    </Grid>

                                    <StackPanel Orientation="Horizontal" Margin="5,1">
                                        <TextBlock Text="Contrato" FontWeight="Bold" Width="105" VerticalAlignment="Center"/>
                                        <TextBox x:Name="txtContrato" Width="200" MaxLength="20" 
                                             TextChanged="txtContrato_TextChanged"/>
                                    </StackPanel>
                                    <StackPanel Orientation="Horizontal" Margin="5,1">
                                        <TextBlock Text="Cliente" FontWeight="Bold" Width="105" VerticalAlignment="Center"/>
                                        <slr:AutoCompleteBoxFix x:Name="txtCliente" Width="200" Height="22"
                                                                IsTextCompletionEnabled="True" MinimumPrefixLength="2"
                                                                ValueMemberPath="NomeCliente"
                                                                ItemTemplate="{StaticResource DataTemplateCliente}"
                                                                SelectionChanged="txtCliente_SelectionChanged" />
                                            <!--<sdk:AutoCompleteBox.ItemTemplate>
                                                <DataTemplate>
                                                    <StackPanel Orientation="Vertical" MinWidth="{Binding Path=Width, ElementName=txtCliente}">
                                                        <TextBlock Text="{Binding Path=NomeCliente}" />
                                                        <StackPanel Orientation="Horizontal" HorizontalAlignment="Right">
                                                            <TextBlock Text="{Binding Path=CnpjCpf, Converter={StaticResource FormatCnpjCpfConverter}}" FontSize="9" Foreground="Blue" />
                                                            <TextBlock Text=" | Id: " FontSize="9" Foreground="Black" Margin="5,0,0,0" />
                                                            <TextBlock Text="{Binding Path=IdCliente}" FontSize="9" Foreground="Blue" Margin="5,0,20,0" />
                                                        </StackPanel>
                                                    </StackPanel>
                                                </DataTemplate>
                                            </sdk:AutoCompleteBox.ItemTemplate>
                                        </slr:AutoCompleteBoxFix>-->
                                    </StackPanel>
                                    <StackPanel Orientation="Horizontal" Margin="5,1">
                                        <TextBlock Text="Produto" FontWeight="Bold" Width="105" VerticalAlignment="Center"/>
                                        <slr:AutoCompleteBoxFix x:Name="txtProduto" Width="200" Height="22"
                                                                IsTextCompletionEnabled="True" MinimumPrefixLength="1"
                                                                SelectionChanged="txtProduto_SelectionChanged" />
                                    </StackPanel>
                                    <StackPanel Orientation="Horizontal" Margin="5,1">
                                        <TextBlock Text="Modalidade" FontWeight="Bold" Width="105" VerticalAlignment="Center"/>
                                        <ComboBox x:Name="cboModalidade" Width="200" SelectionChanged="cboModalidade_SelectionChanged"/>
                                    </StackPanel>
                                    <StackPanel Orientation="Horizontal" Margin="5,1">
                                        <TextBlock Text="Nº Garantia" FontWeight="Bold" Width="105" VerticalAlignment="Center"/>
                                        <TextBox x:Name="txtNumero" Width="200" MaxLength="10" slrv:TextBoxFilterService.Filter="Integer"
                                                 GotFocus="TextBox_GotFocus" />
                                    </StackPanel>

                                    <Border Margin="0,2,0,0" CornerRadius="0,0,5,5" Background="#DEE5E5E5">
                                        <TextBlock Name="txtDuplicidade" FontSize="11" Height="15"
                                                   HorizontalAlignment="Stretch" Foreground="#FFE13511" TextAlignment="Center" />
                                    </Border>
                                </StackPanel>
                            </Border>

                            <Border CornerRadius="5,5,5,5" BorderThickness="1" BorderBrush="#FF5A7194" Background="White" Margin="0,2">
                                <StackPanel Orientation="Vertical">
                                    <StackPanel Orientation="Horizontal" Margin="5,5,5,1">
                                        <TextBlock Text="Instrumento" FontWeight="Bold" Width="105" VerticalAlignment="Center"/>
                                        <ComboBox x:Name="cboInstrumento" Width="200"
                                              SelectionChanged="cboInstrumento_SelectionChanged"
                                              SelectedItem="{Binding Path=IdInstrumento}">
                                            <ComboBox.ItemTemplate>
                                                <DataTemplate>
                                                    <StackPanel Orientation="Vertical" MinWidth="{Binding Path=Width, ElementName=cboInstrumento}" Margin="0,0,20,0">
                                                        <TextBlock Text="{Binding Path=Descricao}" />
                                                        <StackPanel Orientation="Horizontal" HorizontalAlignment="Right">
                                                            <TextBlock Text="Transfere Risco: " FontSize="9" Foreground="Black" />
                                                            <TextBlock Text="{Binding Path=TransfereRisco, Converter={StaticResource SimNaoConverter}}" 
                                                                           FontSize="9" Foreground="Blue" />
                                                        </StackPanel>
                                                    </StackPanel>
                                                </DataTemplate>
                                            </ComboBox.ItemTemplate>
                                        </ComboBox>
                                    </StackPanel>
                                    <StackPanel Orientation="Horizontal" Margin="5,1">
                                        <TextBlock Text="Bem" FontWeight="Bold" Width="105" VerticalAlignment="Center"/>
                                        <ComboBox x:Name="cboBem" Width="200"
                                              SelectionChanged="cboBem_SelectionChanged" />
                                    </StackPanel>
                                    <StackPanel Orientation="Horizontal" Margin="5,1">
                                        <TextBlock Text="Natureza" FontWeight="Bold" Width="105" VerticalAlignment="Center"/>
                                        <ComboBox x:Name="cboNatureza" Width="200"
                                              SelectionChanged="cboNatureza_SelectionChanged"
                                              SelectedItem="{Binding Path=CodigoNatureza}">
                                            <ComboBox.ItemTemplate>
                                                <DataTemplate>
                                                    <StackPanel Orientation="Vertical" MinWidth="{Binding Path=Width, ElementName=cboNatureza}" Margin="0,0,20,0">
                                                        <TextBlock Text="{Binding Path=DescricaoNatureza}" />
                                                        <StackPanel Orientation="Horizontal" HorizontalAlignment="Right">
                                                            <TextBlock Text="{Binding Path=Qualidade, Converter={StaticResource DecimalConverter}}" FontSize="9" Foreground="Blue" />
                                                        </StackPanel>
                                                    </StackPanel>
                                                </DataTemplate>
                                            </ComboBox.ItemTemplate>
                                        </ComboBox>
                                    </StackPanel>

                                    <Border Margin="0,2,0,0" CornerRadius="0,0,5,5" Background="WhiteSmoke">
                                        <StackPanel Orientation="Horizontal">
                                            <TextBlock Text="Qualidade da Trinca:" FontSize="11" HorizontalAlignment="Left" Margin="10,0,0,0" />
                                            <TextBlock x:Name="txtQualidadeTrinca" MinWidth="38" FontSize="11" HorizontalAlignment="Left" Margin="5,0" Foreground="#FF1557EB" />
                                            <TextBlock Text="Transfere Risco:" FontSize="11" HorizontalAlignment="Left" Margin="5,0,0,0" />
                                            <TextBlock x:Name="txtTransfereRisco" MinWidth="30" FontSize="11" HorizontalAlignment="Left" Margin="5,0" Foreground="#FF1557EB" />
                                        </StackPanel>
                                    </Border>
                                </StackPanel>
                            </Border>

                            <Border CornerRadius="5,5,5,5" BorderThickness="1" BorderBrush="#FF5A7194" Background="White" Margin="0,2">
                                <StackPanel Orientation="Vertical">
                                    <StackPanel Orientation="Horizontal" Margin="5,5,5,1">
                                        <TextBlock Text="Moeda" FontWeight="Bold" Width="105" VerticalAlignment="Center"/>
                                        <slr:AutoCompleteBoxFix x:Name="cboMoeda" Width="130" Height="22"
                                                                IsTextCompletionEnabled="True"                                                               
                                                                SelectionChanged="ChangedValoresEmReais"
                                                                ValueMemberPath="cd_Moeda"
                                                                ItemTemplate="{StaticResource DataTemplateMoeda}" />
                                            <!--<sdk:AutoCompleteBox.ItemTemplate>
                                                <DataTemplate>
                                                    <StackPanel Orientation="Vertical" Width="200" Margin="0,0,20,0" >
                                                        <TextBlock Text="{Binding Mode=TwoWay, Path=cd_Moeda}"/>
                                                        <StackPanel Orientation="Horizontal" HorizontalAlignment="Right">
                                                            <TextBlock Text="{Binding Mode=TwoWay, Path=nm_Moeda}" FontSize="9" Foreground="Blue" />
                                                            <TextBlock Text=":" FontSize="9" Foreground="Blue" Margin="10,0"/>
                                                            <TextBlock Text="{Binding Mode=TwoWay, Path=ValorCotacao}" FontSize="9" Foreground="Blue"/>
                                                        </StackPanel>
                                                    </StackPanel>
                                                </DataTemplate>
                                            </sdk:AutoCompleteBox.ItemTemplate>
                                        </slr:AutoCompleteBoxFix>-->
                                    </StackPanel>
                                    <StackPanel Orientation="Horizontal" Margin="5,-2,5,1">
                                        <TextBlock Text="Cotação D-1: " VerticalAlignment="Center" FontWeight="Bold" FontSize="10" Margin="105,0,0,0" />
                                        <TextBlock x:Name="lblCotacao" VerticalAlignment="Center" FontWeight="Bold" FontSize="10" Foreground="#FF1B55B1" TextAlignment="Right" MinWidth="53"/>
                                    </StackPanel>

                                    <StackPanel Orientation="Horizontal" Margin="5,1">
                                        <TextBlock Text="Valor Original" FontWeight="Bold" Width="105" VerticalAlignment="Center"/>
                                        <TextBox x:Name="txtValorOriginalMoeda" Width="130" MaxLength="15" TextAlignment="Right" 
                                             slrv:TextBoxFilterService.Filter="Decimal" 
                                             SelectionChanged="ChangedValoresEmReais"                                              
                                                 GotFocus="TextBox_GotFocus" LostFocus="txtTextBoxValor_LostFocus"/>
                                    </StackPanel>
                                    <StackPanel Orientation="Horizontal" Margin="5,-2,5,1">
                                        <TextBlock Text="BRL: " VerticalAlignment="Center" FontWeight="Bold" FontSize="10" Margin="105,0,0,0" />
                                        <TextBlock x:Name="lblValorOriginalEmReais"  VerticalAlignment="Center" FontWeight="Bold" FontSize="10" Foreground="#FF1B55B1" TextAlignment="Right" MinWidth="100"/>
                                    </StackPanel>

                                    <StackPanel Orientation="Horizontal" Margin="5,1">
                                        <TextBlock Text="Valor Atualizado" FontWeight="Bold" Width="105" VerticalAlignment="Center"/>

                                        <TextBox x:Name="txtValorAtualizadoMoeda" Width="130" MaxLength="15" TextAlignment="Right"
                                             slrv:TextBoxFilterService.Filter="Decimal"
                                             SelectionChanged="ChangedValoresEmReais"
                                             GotFocus="TextBox_GotFocus" LostFocus="txtTextBoxValor_LostFocus"/>
                                    </StackPanel>
                                    <StackPanel Orientation="Horizontal" Margin="5,-2,5,2">
                                        <TextBlock Text="BRL: " VerticalAlignment="Center" FontWeight="Bold" FontSize="10" Margin="105,0,0,0" />
                                        <TextBlock x:Name="lblValorAtualizadoEmReais" VerticalAlignment="Center" FontWeight="Bold" FontSize="10" Foreground="#FF1B55B1" TextAlignment="Right" MinWidth="100" />
                                    </StackPanel>
                                </StackPanel>
                            </Border>

                        </StackPanel>

                        <StackPanel Orientation="Vertical" Grid.Row="1" Grid.Column="1" Margin="5,0,0,0">
                            <Border CornerRadius="5,5,5,5" BorderThickness="1" BorderBrush="#FF5A7194" Background="White" Margin="0,2,0,8" Padding="0,3">
                                <StackPanel Orientation="Vertical">
                                    <StackPanel Orientation="Horizontal" Margin="5,1">
                                        <TextBlock Text="Descrição" FontWeight="Bold" Width="95" VerticalAlignment="Center"/>
                                        <TextBox x:Name="txtDescricao" Width="425" MaxLength="50" />
                                    </StackPanel>
                                    <StackPanel Orientation="Horizontal" Margin="5,2">
                                        <CheckBox x:Name="ckbFormalizada" Content="Garantia Formalizada" VerticalAlignment="Center" Margin="94,0,0,0" />
                                        <CheckBox x:Name="ckbSobrepoeAutomatica" Content="Sobrepor a Garantia Automática" VerticalAlignment="Center" Margin="15,0,0,0" />
                                    </StackPanel>
                                </StackPanel>
                            </Border>

                            <StackPanel Orientation="Horizontal">
                                <Border CornerRadius="5,5,5,5" BorderThickness="1" BorderBrush="#FF5A7194" Background="White" Margin="0,2">
                                    <StackPanel Orientation="Vertical">
                                        <Grid Background="White" HorizontalAlignment="Left" Margin="10,-8,0,2">
                                            <TextBlock Text="Ações" FontSize="11" Margin="5,0"/>
                                        </Grid>

                                        <StackPanel Orientation="Horizontal" Margin="5,1">
                                            <TextBlock Text="Codigo da Ação" Width="95" VerticalAlignment="Center"/>
                                            <TextBox x:Name="txtCodigoAcao" Width="130" MaxLength="20"
                                                 GotFocus="TextBox_GotFocus"/>
                                        </StackPanel>
                                        <StackPanel Orientation="Horizontal" Margin="5,1">
                                            <TextBlock Text="Codigo da Bolsa" Width="95" VerticalAlignment="Center"/>
                                            <TextBox x:Name="txtCodigoBolsa" Width="130" MaxLength="20"
                                                 GotFocus="TextBox_GotFocus"/>
                                        </StackPanel>
                                        <StackPanel Orientation="Horizontal" Margin="5,1">
                                            <TextBlock Text="Avaliação" Width="95" VerticalAlignment="Center"/>
                                            <sdk:DatePicker x:Name="dpDtAvaliacao" Width="130" />
                                        </StackPanel>
                                    </StackPanel>
                                </Border>

                                <StackPanel Orientation="Vertical" Margin="5,0,0,0">
                                    <Border CornerRadius="5,5,5,5" BorderThickness="1" BorderBrush="#FF5A7194" Background="White" Margin="0,2" Padding="0,0,0,4">
                                        <StackPanel Orientation="Vertical">
                                            <Grid Background="White" HorizontalAlignment="Left" Margin="10,-8,0,2">
                                                <TextBlock Text="Vencimento" FontSize="11" Margin="5,0"/>
                                            </Grid>
                                            <StackPanel Orientation="Horizontal" Margin="5,1">
                                                <RadioButton x:Name="rdbVencNaOperacao" GroupName="Vencimento" Content="Na operação" VerticalAlignment="Center" IsChecked="True" Width="130" />
                                                <RadioButton x:Name="rdbVencNaData" GroupName="Vencimento" Content="" VerticalAlignment="Center" />
                                                <sdk:DatePicker x:Name="dpDtVencNaData" IsEnabled="{Binding ElementName=rdbVencNaData, Path=IsChecked}" />
                                            </StackPanel>
                                        </StackPanel>
                                    </Border>

                                    <Border CornerRadius="5,5,5,5" BorderThickness="1" BorderBrush="#FF5A7194" Background="White" Margin="0,8,0,2" Padding="0,0,0,3">
                                        <StackPanel Orientation="Vertical">
                                            <Grid Background="White" HorizontalAlignment="Left" Margin="10,-8,0,2">
                                                <TextBlock Text="Incidência (%)" FontSize="11" Margin="5,0"/>
                                            </Grid>
                                            <StackPanel Orientation="Horizontal" Margin="5,1">
                                                <toolkit:NumericUpDown x:Name="txtIncidencia" Maximum="100" Height="22" Width="50" Margin="0,0,3,0" />
                                                <ComboBox x:Name="cboMotivoIncidencia" Grid.Row="0" Grid.Column="1"
                                                      VerticalAlignment="Center" HorizontalAlignment="Left" 
                                                      Height="22" Width="225" 
                                                      SelectedItem="{Binding Mode=TwoWay, Path=Codigo}">
                                                    <ComboBox.ItemTemplate>
                                                        <DataTemplate>
                                                            <StackPanel Orientation="Vertical" Width="{Binding Path=Width, ElementName=cboMotivoIncidencia}">
                                                                <TextBlock Text="{Binding Mode=TwoWay, Path=Descricao}" />
                                                                <TextBlock Text="{Binding Mode=TwoWay, Path=Codigo}" 
                                                                       FontSize="9" Foreground="Red" Margin="0,0,30,0" HorizontalAlignment="Right" />
                                                            </StackPanel>
                                                        </DataTemplate>
                                                    </ComboBox.ItemTemplate>
                                                </ComboBox>
                                            </StackPanel>
                                        </StackPanel>
                                    </Border>
                                </StackPanel>

                            </StackPanel>

                            <Border CornerRadius="5,5,5,5" BorderThickness="1" BorderBrush="#FF5A7194" Background="White" Margin="0,8,0,2" Padding="0,0,0,3">
                                <StackPanel Orientation="Vertical">
                                    <Grid Background="White" HorizontalAlignment="Left" Margin="10,-8,0,2">
                                        <TextBlock Text="Garantidores" FontSize="11" Margin="5,0"/>
                                    </Grid>

                                    <StackPanel Orientation="Horizontal" Margin="5,2">
                                        <TextBlock Text="Garantidor" Width="95" VerticalAlignment="Center" />
                                        <sdk:AutoCompleteBox x:Name="txtGarantidor" Width="300" 
                                                             IsTextCompletionEnabled="True" MinimumPrefixLength="2"                                                                                                                          
                                                             ItemTemplate="{StaticResource DataTemplateCliente}"
                                                             ValueMemberPath="NomeCliente"
                                                             KeyUp="txtGarantidor_KeyUp" />
                                            <!--<sdk:AutoCompleteBox.ItemTemplate>
                                                <DataTemplate>
                                                    <StackPanel Orientation="Vertical" MinWidth="{Binding Path=Width, ElementName=txtGarantidor}">
                                                        <TextBlock Text="{Binding Path=NomeCliente}" />
                                                        <StackPanel Orientation="Horizontal" HorizontalAlignment="Right">
                                                            <TextBlock Text="{Binding Path=CnpjCpf, Converter={StaticResource FormatCnpjCpfConverter}}" FontSize="9" Foreground="Blue" />
                                                            <TextBlock Text=" | Id: " FontSize="9" Foreground="Black" Margin="5,0,0,0" />
                                                            <TextBlock Text="{Binding Path=IdCliente}" FontSize="9" Foreground="Blue" Margin="5,0,20,0" />
                                                        </StackPanel>
                                                    </StackPanel>
                                                </DataTemplate>
                                            </sdk:AutoCompleteBox.ItemTemplate>
                                        </sdk:AutoCompleteBox>-->

                                        <Button x:Name="btnIncluirGarantidor" Height="22" Width="22" Margin="5,0,0,0"
                                            Click="btnIncluirGarantidor_Click">
                                            <Image Source="{StaticResource IconeAdicionar}" Height="16" Width="16" />
                                        </Button>
                                    </StackPanel>

                                    <sdk:DataGrid x:Name="dataGridGarantidor" Margin="5,2" Height="170" 
                                              AutoGenerateColumns="False" 
                                              HorizontalScrollBarVisibility="Auto"
                                              VerticalScrollBarVisibility="Auto"
                                              ItemsSource="{Binding}">
                                        <sdk:DataGrid.Columns>
                                            <sdk:DataGridTextColumn Header="Id" Binding="{Binding IdPessoa}" Width="1" IsReadOnly="True" Visibility="Collapsed" />
                                            <sdk:DataGridTextColumn Header="Nome" Binding="{Binding Nome}" Width="200" IsReadOnly="True" />
                                            <sdk:DataGridTextColumn Header="CPF / CNPJ" Binding="{Binding CpfCnpj}" Width="150" IsReadOnly="True" />
                                            <sdk:DataGridTextColumn Header="IdGarantia" Binding="{Binding IdGarantia}" Width="150" IsReadOnly="True" Visibility="Collapsed" />
                                            <sdk:DataGridTextColumn Header="IdGarantidor" Binding="{Binding IdGarantidor}" Width="150" IsReadOnly="True" Visibility="Collapsed" />
                                            <sdk:DataGridTextColumn Header="Tipo" Binding="{Binding TipoPessoa}" Width="80" IsReadOnly="True" />
                                            <sdk:DataGridTextColumn Header="Perc. %" Binding="{Binding PercentualGarantidor}" Width="50" />
                                            <sdk:DataGridTemplateColumn>
                                                <sdk:DataGridTemplateColumn.CellTemplate>
                                                    <DataTemplate>
                                                        <Button x:Name="btnExcluirGarantidor" IsEnabled="{Binding IsEnabled, ElementName=btnIncluirGarantidor}"
                                                            Click="btnExcluirGarantidor_Click">
                                                            <Image Source="{StaticResource IconeRemover}" Width="16" Height="16" />
                                                        </Button>
                                                    </DataTemplate>
                                                </sdk:DataGridTemplateColumn.CellTemplate>
                                            </sdk:DataGridTemplateColumn>
                                        </sdk:DataGrid.Columns>
                                    </sdk:DataGrid>
                                </StackPanel>
                            </Border>

                        </StackPanel>

                    </Grid>

                </Grid>
                <slc:ControlMenuBar x:Name="barraMenu" Grid.Row="3" VisibilityUserPanel="Collapsed" 
                                BorderRadius="15,0,15,0" Background="{StaticResource BlueStrong}"/>
            </StackPanel>
        </toolkit:BusyIndicator>
        
    </Grid>
</controls:ChildWindow> 